const mysql = require('mysql');
const con = mysql.createConnection({
    host:'localhost',
    port:3306,
    user:'root',
    password:'root',
    database:'demo'
})

con.connect();

// 封装
function myquery(sql){
    return new Promise((resolve,reject)=>{
        con.query(sql,(err,result)=>{
            resolve([err,result])
        })
    })
}



module.exports= myquery;